/*
 * Application.java
 */

package xq.ide;

import xq.ide.forms.XQueryFrame;
import java.awt.EventQueue;
import javax.swing.UIManager;

/**
 *
 * @author ThorntonRP
 */
public class Application {

	private static Application instance = new Application();
	private XQueryFrame mainFrame;

	private Application() {
	}

	public synchronized static Application getInstance() {
		return instance;
	}

	public synchronized XQueryFrame getMainFrame() {
		if (mainFrame == null) {
			mainFrame = new XQueryFrame();
		}
		return mainFrame;
	}

	public static void main(String[] args) {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception ex) {
			ex.printStackTrace();
		}

		EventQueue.invokeLater(new Runnable() {

			@Override
			public void run() {
				try {
					getInstance().getMainFrame().setVisible(true);
				} catch (Exception ex) {
					ex.printStackTrace();
				}
			}
		});
	}
}
